package com.linjian.togetherbirthday.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.linjian.togetherbirthday.R;
import com.linjian.togetherbirthday.base.BaseFragment;

public class EditFragment extends BaseFragment implements View.OnClickListener {

    private ImageView backIv;
    private TextView titleTv,rightTv;

    public static EditFragment newInstance() {
        EditFragment editFragment = new EditFragment();
        Bundle bundle = new Bundle();
//        bundle.putInt(Integer.class.getName(), resId);
        editFragment.setArguments(bundle);
        return editFragment;
    }

    @Override
    protected int setView() {
        return R.layout.fragment_edit;
    }

    @Override
    protected void init(View view) {
        backIv = view.findViewById(R.id.layout_head_back_iv);
        titleTv = view.findViewById(R.id.layout_head_title_tv);
        rightTv = view.findViewById(R.id.layout_head_right_tv);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        titleTv.setText("编辑个人资料");
        rightTv.setText("保存");
        setListener();
    }

    private void setListener() {
        backIv.setOnClickListener(this);
        rightTv.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.layout_head_back_iv:
                getActivity().getSupportFragmentManager().popBackStack();
                break;
            case R.id.layout_head_right_tv:

                break;
        }
    }
}
